import React, { Component } from 'react';
import { NavBar, Icon } from 'antd-mobile';
class Header extends Component {
  constructor (props) {
    super(props)
    this.state = {
    }
  }
  componentDidMount(){
    // console.log(this.props.test)
  }
  showfenlei () {
    console.log('展示信息')
  }
  goback () {
    this.props.test.props.history.goBack()
  }
  goUser () {
    this.props.test.props.history.push('/login')
  }
  render () {
    return (
      <header className = "header">
        <NavBar
          mode="dark"
          icon={<Icon type="left" />}
          onLeftClick={this.goback.bind(this)}
          rightContent={[
            // <Icon key="0" type="search" style={{ marginRight: '16px' }} />,
            // <Icon key="1" type="ellipsis" onClick= { this.showfenlei} />,
            <p className = "iconfont icon-iconwode" key="0" onClick = {this.goUser.bind(this)} ></p>,
          ]}
        >新浪新闻</NavBar>
      </header>
    )
  }
}
export default Header